﻿using System;
using System.Linq;

using Mono.Cecil;

namespace Mono.Cecil.Tests {

	static class Extensions {

		public static MethodDefinition GetMethod (this TypeDefinition type, string name)
		{
			return type.Methods.Where (m => m.Name == name).First ();
		}

		public static FieldDefinition GetField (this TypeDefinition type, string name)
		{
			return type.Fields.Where (f => f.Name == name).First ();
		}
	}
}
